<template>
  <div>
    <el-button
      :icon="DocumentCopy"
      circle
      color="#626aef"
      size="small"
      @click="CopyHandle"
    />
  </div>
</template>

<script setup lang="ts">
import { $t } from '@vben/locales';

import { DocumentCopy } from '@element-plus/icons-vue';

const props = defineProps({
  // 消息体
  content: {
    type: String,
    default: '',
  },
});
// 复制消息
const CopyHandle = () => {
  navigator.clipboard.writeText(props.content || '');
  ElMessage.success($t('customer.chat.copySuccess'));
};
</script>
